import { useMemo } from 'react';
import Loading from './Loading/Loading';
import CompleteLoad from './CompleteLoad/CompleteLoad';
import Nodata from './NoData/NoData';

export const useLoadingOption = (loadingStatus: string) => {
    const CompObj = {
        Loading: <Loading></Loading>,
        complete: <CompleteLoad></CompleteLoad>,
        nodata: <Nodata></Nodata>
    };
    const CompOptions = useMemo(() => CompObj[loadingStatus], [loadingStatus]);
    return { CompOptions };
};
